package com.zhiyizhen.handheld.component;

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;

import com.zhiyizhen.handheld.common.DataCache;
import com.zhiyizhen.handheld.common.view.BaseActivity;
import com.zhiyizhen.handheld.component.login.LoginActivity;
import com.zhiyizhen.handheld.component.login.bean.LoginBean;
import com.zhiyizhen.handheld.component.main.MainActivity;

public class LauncherActivity extends BaseActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LoginBean loginBean = DataCache.getLoginBean();
        if (loginBean != null) {
            startActivity(new Intent(LauncherActivity.this, MainActivity.class));
            finish();
        } else {
            startActivity(new Intent(this, LoginActivity.class));
            finish();
        }
    }

}
